#include<bits/stdc++.h>
using namespace std;
int main()
{
	vector<int> a;
	int n, x;
	while(cin>>n && n)
	{
		vector<int>().swap(a);
		for(int i = 1;i <= n;i++)
		{
			cin>>x;
			a.emplace_back(x); 
		}
		sort(a.begin(), a.end());
		int mx = a[n-1];
		int mn = a[0];
		double mid = n%2 ? a[n/2] : (a[n/2-1]+a[n/2])/2.0;
		printf("%.3f\n", (mx+mn+mid)/3.0);
	}
	return 0;
}

